/*
package cn.findviewbydream.evil.main.crawler;

import us.codecraft.webmagic.Page;
import us.codecraft.webmagic.Site;
import us.codecraft.webmagic.Spider;
import us.codecraft.webmagic.processor.PageProcessor;
import us.codecraft.webmagic.processor.example.GithubRepoPageProcessor;

import java.util.List;

*/
/********************************************
 * 工程名：HebeuCS
 * 包名：cn.findviewbydream.evil.main.crawler
 * 时间：16-10-31 下午8:37
 * 作者：白雨濃 evil
 * 邮箱：evilbai@foxmail.com
 * 内容：爬虫测试
 ********************************************//*

public class CrawlerTest implements PageProcessor
{
    private Site site = Site.me().setRetryTimes(3).setSleepTime(1);

    @Override
    public void process(Page page)
    {
        List<String> name = page.getHtml().xpath("//li/a[@title]/text()").all();
        List<String> href = page.getHtml().xpath("//li/a[@title]/@href").all();

        for (int i = 0; i < name.size(); i++)
        {
            System.out.println(name.get(i) + ":" + href.get(i));
        }
    }

    @Override
    public Site getSite()
    {
        return site;
    }

    public static void main(String[] args)
    {
        Spider.create(new CrawlerTest()).addUrl("http://www.dy2018.com/").thread(5).run();
    }
}*/
